﻿@using ChampionsLeagueBets.Domain
@using MvcContrib
@using MvcContrib.UI.Grid
@model IList<Tournament>

@{
    ViewBag.Title = "Strona główna";
	ViewBag.Image = "~/Content/images/casino-64.png";
}


<div id="content">

@foreach (var tournament in Model)
{
	string unitName = tournament.UnitOfAccount != null && !string.IsNullOrEmpty(tournament.UnitOfAccount.ShortName) ? tournament.UnitOfAccount.ShortName : string.Empty;
	<div class="game-date">@tournament.Name</div>
	
	@Html.Grid(tournament.TournamentUserResults.OrderByDescending(o => o.Points).Take(5)).RowAttributes(data => new Hash(@class => data.IsAlternate ? "row-normal" : "row-grayed")).Columns(column =>
			{
				column.For(cust => cust.User.FullName);
				column.For(cust => cust.Points);
				column.For(cust => cust.Win + " " + unitName);
			}
		)
}
</div>
